package com.kanas.webak.organization.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.kanas.framework.support.AbstractModel;
import com.kanas.framework.util.StringUtils;

@Entity(name="KanasCalendar")
@Table(name = "kanas_calendar")
@JsonIgnoreProperties({"organization"})
public class Calendar extends AbstractModel {

	@Transient
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "id", length = 32)
	private String id;
	@Column(name = "affair", length =200)
	private String affair;
	@Column(name = "work_flag")
	private Boolean workdayFlag;
	@Column(name = "begin_date")
	@Temporal(TemporalType.DATE)
	private Date beginDate;
	@Column(name = "end_date")
	@Temporal(TemporalType.DATE)
	private Date endDate;
	@Column(name = "rule_flag")
	private Boolean ruleFlag;
	@Column(name = "sunday")
	private Boolean sunday;
	@Column(name = "monday")
	private Boolean monday;
	@Column(name = "tuesday")
	private Boolean tuesday;
	@Column(name = "wednesday")
	private Boolean wednesday;
	@Column(name = "thursday")
	private Boolean thursday;
	@Column(name = "friday")
	private Boolean friday;
	@Column(name = "saturday")
	private Boolean saturday;
	@Column(name = "sort_number")
	private Integer sortNumber;
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="org_id",referencedColumnName="id")
	private Organization organization;
	
	public Calendar() {
		this.id = StringUtils.generateUUID();
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAffair() {
		return affair;
	}

	public void setAffair(String affair) {
		this.affair = affair;
	}

	public Boolean getWorkdayFlag() {
		return workdayFlag;
	}

	public void setWorkdayFlag(Boolean workdayFlag) {
		this.workdayFlag = workdayFlag;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

	public Boolean getRuleFlag() {
		return ruleFlag;
	}

	public void setRuleFlag(Boolean ruleFlag) {
		this.ruleFlag = ruleFlag;
	}

	public Boolean getSunday() {
		return sunday;
	}

	public void setSunday(Boolean sunday) {
		this.sunday = sunday;
	}

	public Boolean getMonday() {
		return monday;
	}

	public void setMonday(Boolean monday) {
		this.monday = monday;
	}

	public Boolean getTuesday() {
		return tuesday;
	}

	public void setTuesday(Boolean tuesday) {
		this.tuesday = tuesday;
	}

	public Boolean getWednesday() {
		return wednesday;
	}

	public void setWednesday(Boolean wednesday) {
		this.wednesday = wednesday;
	}

	public Boolean getThursday() {
		return thursday;
	}

	public void setThursday(Boolean thursday) {
		this.thursday = thursday;
	}

	public Boolean getFriday() {
		return friday;
	}

	public void setFriday(Boolean friday) {
		this.friday = friday;
	}

	public Boolean getSaturday() {
		return saturday;
	}

	public void setSaturday(Boolean saturday) {
		this.saturday = saturday;
	}

	public Integer getSortNumber() {
		return sortNumber;
	}

	public void setSortNumber(Integer sortNumber) {
		this.sortNumber = sortNumber;
	}

	@Override
	public String toIdString() {
		return id;
	}
	
}
